import request from '@/utils/request'
//登录接口函数
export function login({ username, password }) {
  return request({
    url: `/ucenter/student/loginByNumber/${username}`,
    method: 'post',
    params: { username, password }
  })
}
//获得初始用户信息接口函数
export function getInfo(token) {
  return request({
    url: '/ucenter/student/getUserInfo',
    method: 'post',
    params: { token }
  })
}
//退出登录接口函数
export function logout() {
  return request({
    url: '/ucenter/student/loginOut',
    method: 'post'
  })
}

export function shangchuanPhoto(image) {
  return request({
    url: '/examoss/faceaip/registerFace',
    method: 'post',
    data:{
      imagebast64:image,
    }
  })
}

export function updatePhoto(image) {
  return request({
    url: '/examoss/faceaip/updateFace',
    method: 'post',
    data:{
      imagebast64:image,
    }
  })
}

// @RequestBody ImageBase64 image, HttpServletRequest request, String examId
export function checkPhotoForExam(image,examId) {
  return request({
    url: '/examoss/faceaip/faceCheck',
    method: 'post',
    params:{examId},
    data:{
      imagebast64:image,
    }
  })
}

export function checkPhotoNormal(image) {
  return request({
    url: '/examoss/faceaip/faceCheckNormal',
    method: 'post',
    data:{
      imagebast64:image,
    }
  })
}

// 通过token获得studentId
export function getStudentId() {
  return request({
    url: '/ucenter/student/getStudentId',
    method: 'get',
  })
}